/**
 * Copyright (C) 2011 Andrew C. Love (DNC) <dnc.app.sup@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.dnc.cloak.framework.security.encryption;

public interface EncryptionProperties {

    // Encryption Modes
    public static final String PKI                                 = "PKI";
    public static final String SYM                                 = "SYM";
    public static final String SESSION_KEY                         = "SESSION_KEY";

    public static final int	SESSION_KEY_LENGTH = 12;
    
    public static final String ENABLE_ENCRYPTION                   = "com.techrx.security.encryption";
    // Default keystore type
    public static final String KEYSTORE_TYPE                       = "com.techrx.security.jce.storetype";
    // Certificate path
    public static final String CERT_FILE_PATH                      = "com.techrx.security.x509cert.cer";
    // x509 Distinguished Name
    public static final String CERT_DISTINGUISHED_NAME             = "com.techrx.security.x509cert.cer.distinguishedname";
    // x509 Distinguished Name
    public static final String CERT_DAYS_VALID                     = "com.techrx.security.x509cert.cer.valid";
    // Automatic cert generation
    public static final String CERT_NEW_ON_EXPIRE                  = "com.techrx.security.x509cert.cer.auto";
    // Keystore name
    public static final String KEYSTORE                            = "com.techrx.security.jce.keystore";
    // Keystore Passwd
    public static final String KEYSTORE_PASS                       = "com.techrx.security.jce.keystorepass";
    // Key Alias
    public static final String KEY_ALIAS                           = "com.techrx.security.jce.keyalias";
    // Key Passwd
    public static final String KEY_PASS                            = "com.techrx.security.jce.keypass";
    // Encryption mode
    public static final String ENCRYPT_MODE                        = "com.techrx.security.jce.encryptmode";
    // Encryption algorithm
    public static final String PKI_ALGORITHM                       = "com.techrx.security.jce.pki.algorithm";
    // Cipher Transformation
    public static final String PKI_TRANSFORMATION                  = "com.techrx.security.jce.pki.transformation";
    // Certificate Signature Algorithm
    public static final String SIGNATURE_ALGORITHM                 = "com.techrx.security.jce.pki.signature.algorithm";
    // Encryption algorithm
    public static final String SYM_ALGORITHM                       = "com.techrx.security.jce.sym.algorithm";
    // Cipher Transformation
    public static final String SYM_TRANSFORMATION                  = "com.techrx.security.jce.sym.transformation";
    // Key init size
    public static final String SYM_KEY_INIT_SIZE                   = "com.techrx.security.jce.sym.keyinitsize";
    // Key init size
    public static final String PKI_KEY_INIT_SIZE                   = "com.techrx.security.jce.pki.keyinitsize";
    // Encryption max length
    public static final String MAX_LENGTH                          = "com.techrx.security.jce.maxlength";
    // Cache certificate on the client
    public static final String CACHE_CLIENT_CERT                   = "com.techrx.security.jce.cache.client.cert";
    // Max duraction before check for new cert
    public static final String CACHE_MAX_DURATION                  = "com.techrx.security.jce.cache.client.cert.maxduration";

    // Provider property
    // These 2 properties are not required when we register statically
    // Used when we choose to register dynamically and we want to override the
    // default
    public static final String JCE_PROVIDER                        = "com.techrx.security.jce.provider";
    // JCE properties file
    public static final String JCE_PROPERTIES                      = "jce.properties";
    // X.509 Certificate
    public static final String X509                                = "X.509";
    // Passwd Properties encrypted
    public static final String PASSWD_PROPS_ENCRYPTED              = "com.techrx.security.jce.password.encrypted";

    // Cache Properties
    public static final String CACHE_TOPIC_ENCRYPTION_CERTIFICATES = "CACHE_TOPIC_ENCRYPTION_CERTIFICATES";
    public static final String CACHE_KEY_ENCRYPTION_CERTIFICATE    = ".enc.cer.key";
    public static final String CACHE_CHECK_FOR_UPDATE_MAX_DURATION = ".enc.cer.key.duration";
    public static final String CACHE_LAST_CHECK_DATE               = ".last.update";

    public static final int           DEFAULT_MAX_LENGTH           = 4096;

    // Default property values
    public static final String DEFAULT_KEYSTORE_NAME               = "CLOAK_DEFAULT_KEYSTORE";
    public static final String DEFAULT_KEYSTORE_TYPE               = "jks";
    public static final String DEFAULT_KEYSTORE                    = "keystore/dnc.jks";
    public static final String DEFAULT_KEYSTORE_PASS               = "dnc!789123";
    public static final String DEFAULT_KEY_ALIAS                   = "dncalias";
    public static final String DEFAULT_KEY_PASS                    = "dnc!789123";
    public static final String DEFAULT_PKI_ALGORITHM               = "RSA";
    public static final String DEFAULT_PKI_TRANSFORMATION          = "RSA/ECB/PKCS1Padding";
    public static final String DEFAULT_SYM_ALGORITHM               = "AES";
    public static final int    DEFAULT_PKI_KEY_INIT_SIZE           = 512;
    public static final int	   DEFAULT_SYM_KEY_INIT_SIZE           = 128;
    public static final String DEFAULT_SYM_TRANSFORMATION          = "AES/ECB/PKCS7Padding";
    public static final String DEFAULT_JCE_PROVIDER                = "org.bouncycastle.jce.provider.BouncyCastleProvider";
    public static final String DEFAULT_PASSWD_PROPS_ENCRYPTED      = "false";
    public static final String DEFAULT_CACHE_CLIENT_CERT           = "false";
    public static final String DEFAULT_CACHE_MAX_DURATION          = ((24 * 60 * 60 * 1000) * 7) + "";
    public static final String DEFAULT_DISTINGUISHED_NAME          = "CN=DNC, OU=DEV, O=OPS, L=Brownstown, ST=MI, C=US";
    public static final String DEFAULT_SIGNATURE_ALGORITHM         = "SHA1withRSA";
    public static final int    DEFAULT_CERT_DAYS_VALID             = 182;
    public static final String DEFAULT_CERT_NEW_ON_EXPIRE          = "false"; 
    
}